<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>
      <h1>代表标签的模板字符串</h1>
    </div>
    <script>
      const str = console.log`hello world`; //['hello world']

      const name = "tom";
      const gender = true;
      function tagFunc(strings, name, gender) {
        console.log(strings, name, gender); //带标签的模板字符串可以打印静态成员["hey,", " is a ", "", raw: Array(3)],后面两个参数接收动态传入的值，函数内部的返回值就是下面带标签模板字符串的值
        return "这是模板字符串的返回值";
      }
      const result = tagFunc`hey,${name} is a ${gender}`;
      console.log(result);
    </script>
  </body>
</html>
